Add _gtk_toggle_action_set_active() internal function
authorJavier Jardón <jjardon@gnome.org>
Fri, 16 Jul 2010 16:34:46 +0000 (18:34 +0200)
committerJavier Jardón <jjardon@gnome.org>
Mon, 19 Jul 2010 13:16:03 +0000 (15:16 +0200)
It's needed in gtkradioaction

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=624540

gtk/gtkradioaction.c
gtk/gtktoggleaction.c
gtk/gtktoggleaction.h

index 96f1163205ff523e99d59e48a0a45e389de4f593..47cb3f4c5c0ce3c93d0d6339e5c9fd60870c121b 100644 (file)
@@ -338,7 +338,7 @@ gtk_radio_action_activate (GtkAction *action)
          if (gtk_toggle_action_get_active (tmp_action) &&
               (tmp_action != toggle_action))
            {
-              gtk_toggle_action_set_active (toggle_action, !active);
+              _gtk_toggle_action_set_active (toggle_action, !active);
 
              break;
            }
@@ -347,7 +347,7 @@ gtk_radio_action_activate (GtkAction *action)
     }
   else
     {
-      gtk_toggle_action_set_active (toggle_action, !active);
+      _gtk_toggle_action_set_active (toggle_action, !active);
       g_object_notify (G_OBJECT (action), "active");
 
       tmp_list = radio_action->private_data->group;
index ae820826135c656fbcc66df1d4a93a47b09b07eb..86ec59ba43db6c9bee06011057d2d3fbddd113ed 100644 (file)
@@ -364,3 +364,23 @@ create_menu_item (GtkAction *action)
                       "draw-as-radio", toggle_action->private_data->draw_as_radio,
                       NULL);
 }
+
+
+/* Private */
+
+/*
+ * _gtk_toggle_action_set_active:
+ * @toggle_action: a #GtkToggleAction
+ * @is_active: whether the action is active or not
+ *
+ * Sets the #GtkToggleAction:active property directly. This function does
+ * not emit signals or notifications: it is left to the caller to do so.
+ */
+void
+_gtk_toggle_action_set_active (GtkToggleAction *toggle_action,
+                               gboolean         is_active)
+{
+  GtkToggleActionPrivate *priv = toggle_action->private_data;
+
+  priv->active = is_active;
+}
index c34336ed4a33c9fd31d5180f9493e7f62f16cc1a..889615230df4eff0faa76feff22389b6701cac22 100644 (file)
@@ -84,6 +84,10 @@ void             gtk_toggle_action_set_draw_as_radio (GtkToggleAction *action,
                                                       gboolean         draw_as_radio);
 gboolean         gtk_toggle_action_get_draw_as_radio (GtkToggleAction *action);
 
+/* private */
+void             _gtk_toggle_action_set_active       (GtkToggleAction *toggle_action,
+                                                      gboolean         is_active);
+
 
 G_END_DECLS